package com.example.g5project.customer.model.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.example.g5project.customer.model.dto.CustomerDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName("customer")
public class CustomerPO extends BasePO {

    private String name;

    private String phone;

    private String password;

    private String contactName;

    private String contactPhone;

    public CustomerDTO convert2DTO() {
        return CustomerDTO.builder()
            .id(this.id)
            .name(this.name)
            .phone(this.phone)
            .contactName(this.contactName)
            .contactPhone(this.contactPhone)
            .build();
    }
}
